import re

with open('htmlsample.html', 'r', encoding='UTF-8') as handler:
    lines = handler.readlines()
    newlines = []
    for line in lines:
        newlines.append(re.sub('<[^<>]*>', '', line)) 
        
with open('htmlsample_new.txt','w') as newfile:
    newfile.writelines(newlines)